package com.cms.service.Impl;

import com.cms.entity.Clazz;
import com.cms.mapper.ClazzMapper;
import com.cms.service.ClazzService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ClazzServiceImpl implements ClazzService {

    @Resource
    private ClazzMapper clazzMapper;

    @Override
    public Integer save(Clazz clazz) {
        return clazzMapper.save(clazz) > 0 ? 1 : 0;
    }

    @Override
    public List<Clazz> list() {
        return clazzMapper.list();
    }

    @Override
    public Integer delete(Integer cid) {
        return clazzMapper.delete(cid) > 0 ? 1 : 0;
    }

    @Override
    public Integer update(Clazz clazz) {
        return clazzMapper.update(clazz) > 0 ? 1 : 0;
    }
}
